# !/usr/bin/env python
# -*-coding:utf-8 -*-

"""
# File       : 使用Block组件自定义页面.py
# Time       ：2025-04-14 21:26
# Author     ：ybli
# Description：
"""
import gradio as gr


def update(name):
    return f"欢迎来到 Gradio，{name}！"


with gr.Blocks() as demo:
    gr.Markdown("在下方输入内容，然后点击 **运行** 查看输出。")
    with gr.Row():
        inp = gr.Textbox(placeholder="请输入你的名字")
        out = gr.Textbox()
    btn = gr.Button("运行")
    btn.click(fn=update, inputs=inp, outputs=out)

demo.launch()
